home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 11 / CU Amiga Magazine's Super CD-ROM 11 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-06].iso / cucd / programming / chipasmsrc / pack.asm < prev    next >
Assembly Source File  |  1996-05-31  |  8KB  |  264 lines

  1. **********************************************************************
  2. *
  3. *    Pack.asm
  4. *    ~~~~~~~~
  5. *    Description : This is the Devious Designs MusIc PacK
  6. *              made for DVS. This is tha final spreadable
  7. *              version...  AGA Only !!
  8. *
  9. *              >>> DO NOT SPREAD THE SOURCE CODE <<<                        
  10. *            
  11. *    Code : Dennis Predovnik (SuLtAn/DVS)
  12. *    Date : 26/4/96
  13. *    Release Version : 1.0
  14. *       Bugs/To Do : 
  15. *            *- Music Fade not properly implemented !
  16. *         *- Bit of code redundancies, Due to hurried release..
  17. *            *- Can easily be optimized to work on A500, but lazy !
  18. *
  19. **********************************************************************
  20.  
  21.     section        main_Code,code
  22.  
  23.     include "include/execbase.i"
  24.         include "include/gfxbase.i"
  25.         include "include/dmabits.i"
  26.         include "include/graphics_lib.i"    
  27.         include "include/exec_lib.i"        
  28.         include "include/intuition_lib.i"  
  29.     include "include/custom.i"
  30.     include    "include/setup.asm"      
  31.  
  32. **********************************************************************
  33. *    Other Macros                             *
  34. **********************************************************************
  35.  
  36. CALL        MACRO
  37.         jsr    _LVO\1(a6)
  38.         ENDM
  39.  
  40. WaitBlit    MACRO
  41.         tst.b    (a6)
  42. .\@        btst    #6,(a6)
  43.         bne.s    .\@
  44.         ENDM
  45.  
  46. WaitVBL        MACRO
  47. .\@
  48.         lea    $dff000,a5
  49.         move.l    4(a5),d7
  50.         and.l    #$1ff00,d7
  51.         cmp.l    #$12000,d7
  52.         bne.s    .\@
  53.         ENDM
  54.  
  55. WaitVBLint    MACRO
  56.         clr.l    VB
  57. .vbc\@
  58.         cmpi    #1,VB
  59.         blt.s    .vbc\@
  60.         ENDM
  61.  
  62. **********************************************************************
  63. *    Other Equates                             *
  64. **********************************************************************
  65.  
  66. _LVOOutput    equ    -60      
  67. _LVOWrite    equ    -48
  68.  
  69.  IFND    GFXB_AA_ALICE
  70.     GFXB_AA_ALICE    SET    2
  71.  ENDC
  72.  
  73.  IFND    gb_ChipRevBits0
  74.     gb_ChipRevBits0    SET    $ec
  75.  ENDC
  76.  
  77.  IFND    PALn
  78.     PALn        SET    2
  79.  ENDC
  80.  
  81. **********************************************************************
  82. *    Main Routine                             *
  83. **********************************************************************
  84.  
  85.     SETUPALL 
  86.  
  87.     move.l     #PICBLPT,a0                  ; Insert PIC in Copper
  88.     move.l     #OPENPIC,d0                    ; OPEN Pic !!
  89.     moveq    #8-1,d1                         ; 8 Planes..
  90.     move.l    #(320*256)/8,d2                 ; 320 * 256
  91.     move.l    #8,d3                        ; 8 byte size
  92.     jsr     insertCopper    
  93.  
  94.     clr.w    VB                 ; Reset VB Counter !
  95.     move.l  #PICLOGOBK,a0                ; Source palette
  96.     move.l    #OPENPAL,a1                  ; Destination palette
  97.     add.l    #2,a0                        ; Skip colour zero !
  98.     add.l    #6,a1                        ; Skip colour zero !
  99.     move.l    #512-1,d0                    ; Number of Colours-1
  100.     move.w  #0,d1                        ; Fade Delay !
  101.         move.l    #4,d7                        ; Modulo
  102.     jsr    fadeIn
  103.  
  104.     jsr    init                        ; System Takeover etc !!
  105.     jsr    PT_End                       ; Make sure any music ended !
  106.     jsr    initINIT
  107.     jsr    PT_Init                  ; Initialize replay
  108.     move.l    $6C.W,INTSAVE             ; Get VB Interupt 
  109.         jsr    _GetVBR                 ; Happening !
  110.     move.l    d0,a0
  111.     move.l    #VBInt,$6c(a0)
  112.  
  113.     clr.w    VB                 ; Reset VB Counter !
  114.     move.l  #PICLOGOFK,a0                ; Source palette
  115.     move.l    #OPENPAL,a1                  ; Destination palette
  116.     add.l    #2,a0                        ; Skip colour zero !
  117.     add.l    #6,a1                        ; Skip colour zero !
  118.     move.l    #512-1,d0                    ; Number of Colours-1
  119.     move.w  PDELAY,d1                    ; Fade Delay !
  120.         move.l    #4,d7                 ; Modulo
  121.     jsr    fadeOut
  122.  
  123.     clr.w    VB                 ; Reset VB Counter !
  124.     move.l  #PICLOGONK,a0                ; Source palette
  125.     move.l    #OPENPAL,a1                  ; Destination palette
  126.     add.l    #6,a0                        ; Skip colour zero !
  127.     add.l    #6,a1                        ; Skip colour zero !
  128.     move.l    #512-1,d0                    ; Number of Colours-1
  129.     move.w  PDELAY,d1                    ; Fade Delay !
  130.         move.l    #4,d7                        ; Modulo
  131.     jsr    fadeInAGA
  132.  
  133.     move.l    #250,d0
  134. waitPic:
  135.     WaitVBLint
  136.     dbra    d0,waitPic    
  137.  
  138.     clr.w    VB                 ; Reset VB Counter !
  139.     move.l  #PICLOGOFK,a0                ; Source palette
  140.     move.l    #OPENPAL,a1                  ; Destination palette
  141.     add.l    #2,a0                        ; Skip colour zero !
  142.     add.l    #6,a1                        ; Skip colour zero !
  143.     move.l    #512-1,d0                    ; Number of Colours-1
  144.     move.w  PDELAY,d1                    ; Fade Delay !
  145.         move.l    #4,d7                 ; Modulo
  146.     jsr    fadeOut
  147.  
  148.     clr.w    VB                 ; Reset VB Counter !
  149.     move.l  #PICLOGOBK,a0                ; Source palette
  150.     move.l    #OPENPAL,a1                  ; Destination palette
  151.     add.l    #2,a0                        ; Skip colour zero !
  152.     add.l    #6,a1                        ; Skip colour zero !
  153.     move.l    #512-1,d0                    ; Number of Colours-1
  154.     move.w  PDELAY,d1                    ; Fade Delay !
  155.         move.l    #4,d7                        ; Modulo
  156.     jsr    fadeIn
  157.  
  158.         ;----------------- Odd Planes !! ---------------------
  159.     
  160.     move.l     #MENUBLPT,a0                  ; Insert Menu Screen in Copper
  161.     move.l     menuScreen1,d0                    ; Menu Screen 1 !!
  162.     moveq.w    #2-1,d1                         ; 2 Planes..
  163.     move.l    #(320*230)/8,d2                 ; 320 * 230
  164.     move.l    #16,d3                       ; 16 byte size
  165.     jsr     insertCopper    
  166.  
  167.     move.l     #MENUBLPT+32,a0                 ; Insert Menu Screen in Copper
  168.     move.l     menuScreen1,d0                    ; Menu Screen 1 !!
  169.     add.l    #(320*230*2),d0
  170.     moveq.w    #1-1,d1                         ; 1 Planes..
  171.     move.l    #(320*230)/8,d2                 ; 320 * 230
  172.     move.l    #16,d3                       ; 16 byte size
  173.     jsr     insertCopper
  174.  
  175.         ;----------------- EVEN Planes !! --------------------
  176.         
  177.     move.l     #MENUBLPT+8,a0                  ; Insert Menu Screen in Copper
  178.     move.l     menuScreen1,d0
  179.     add.l    #(320*230*3)/8,d0            ; Menu Screen 1 !!
  180.     moveq.w    #1-1,d1                         ; 1 Plane..
  181.     move.l    #(320*230)/8,d2                 ; 320 * 230
  182.     move.l    #16,d3                       ; 16 byte size
  183.     jsr     insertCopper
  184.  
  185.     move.l     #MENUBLPT+24,a0                 ; Insert Menu Screen in Copper
  186.     move.l     menuScreen1,d0
  187.     add.l    #(320*230*4)/8,d0            ; Menu Screen 1 !!
  188.     moveq.w    #1-1,d1                         ; 1 Plane..
  189.     move.l    #(320*230)/8,d2                 ; 320 * 230
  190.     move.l    #16,d3                       ; 16 byte size
  191.     jsr     insertCopper
  192.  
  193.     move.l    #MENUBLPT+40,a0              ; Insert backdrop in Plane 6 ! 
  194.     move.l  #MAINBACK,d0                 ; Back drop to chuck in..
  195.     moveq.w #1-1,d1                      ; 1 plane
  196.     move.l  #(320*256)/8,d2              ; etc...
  197.         move.l  #16,d3                       ; 16 byte size
  198.     jsr     insertCopper
  199.     
  200.     ;----------------- HiRes Logo View -------------------
  201.     
  202.     move.l     #SPLITPLANE,a0                  ; Insert LOGO in Copper
  203.     move.l     #DVSLOGO1,d0                    ; DVS Logo !!
  204.     moveq.w    #1-1,d1                         ; 1 Plane..
  205.     move.l    #(640*45)/8,d2                    ; 640 * 45, Hi-Res
  206.         move.l  #8,d3
  207.     jsr     insertCopper    
  208.  
  209.     move.l    #LOGOBLPT,a0
  210.     move.l    #DVSLOGO1,d0
  211.     moveq.w    #4-1,d1
  212.     move.l  #(640*45)/8,d2
  213.         move.l  #8,d3
  214.     jsr     insertCopper
  215.     
  216.         ;-----------------------------------------------------
  217.  
  218.     jsr    _GetVBR
  219.     move.l    d0,a0
  220.     move.l    INTSAVE,$6c(a0)                 ; Clear old interuptz !     
  221.         move.l  #NEWCOPPER,$dff080.L         ; Put up main menu !!
  222.     move.l    $6C.W,INTSAVE             ; Get VB Interupt 
  223.         jsr    _GetVBR                 ; Happening !
  224.     move.l    d0,a0
  225.     move.l    #mainInt,$6c(a0)
  226.     jsr    printMenuText
  227.     jsr    showCursor
  228. main:
  229.     WaitVBL
  230.     jsr    checkSelection
  231. chkLeft:
  232.     move.b    $bfe001,d0
  233.     andi.b    #$40,d0
  234.     bne.s    chkRight
  235.     jsr    modInfo
  236. chkRight:
  237.     move.w    $16+$dff000,d0
  238.     btst    #10,d0
  239.     bne.s     main      
  240.  
  241. freeInts:
  242.     jsr    _GetVBR
  243.     move.l    d0,a0
  244.     move.l    INTSAVE,$6c(a0)                 ; Clear old interuptz !
  245.     jsr    PT_End                 ; Shut off Audio
  246.  
  247. NOAGAEXIT:
  248.     jsr    cleanUp                         ; Yep, Let's blow this joint !
  249.     FREEALL                            ; Free Stuff etc..
  250. ExitToDos:
  251.     moveq    #0,d0                 ; Return Code !
  252.     rts
  253.  
  254.  
  255.     include    "include/init.asm"             ; Initialization routines
  256.     include    "include/standardRoutines.asm" ; In alot of my prods..
  257.     include "include/customRoutines.asm"   ; Specific to this pack.
  258.     include    "include/effects.asm"          ; Special FX Routines !!
  259.     include    "include/primitives.asm"       ; WritePixel,DrawLine etc
  260.     include "include/IORoutines.asm"       ; Input/Output routines !
  261.     include    "include/CIAMusic.asm"         ; Music Replayer..
  262.     include    "include/data.asm"             ; Data used in this pack..
  263.     include "modify.asm"                ; Data the "Packer" can change !
  264.